//
// Created by xili on 2024/8/11 13:23.
// Go big or go home.
//
#include "leetcode.h"

class Solution {
public:
    ListNode *trainningPlan(ListNode *head) {
        if (!head || !head->next) {
            return head;
        }
        ListNode *pre = nullptr;
        ListNode *cur = head;
        while (cur) {
            ListNode *temp = cur->next;
            cur->next = pre;
            pre = cur;
            cur = temp;
        }
        return pre;
    }
};